package com.zzy.formatjson;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.poi.ss.formula.functions.T;

import java.text.DecimalFormat;
import java.util.Date;

public class TestJsonFormat {
    public static void main(String[] args) {
        TestJsonFormat t = new TestJsonFormat();
        t.test();

    }

    public void test() {
        double d = 123456789.123;
        DecimalFormat decimalFormat = new DecimalFormat("###,###.##");
        Object o = decimalFormat.format(d);
        System.out.println(o);

        TempJSONModel t = new TempJSONModel();
        t.setDate(new Date());
        t.setMoney(d);
        System.out.println(JSONObject.toJSONString(t));

    }



}
